package com.mud.dnd.ejb.services;


import javax.ejb.Local;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionManagement;

import com.mud.dnd.domain.common.DAOException;
import com.mud.dnd.domain.model.User;
import com.mud.dnd.domain.model.User.Role;
import com.mud.dnd.ejb.common.AuthenticationException;

@Local
@TransactionManagement
public interface AuthenticationService {

	@TransactionAttribute
	public abstract String loginUser(String name, String password) throws DAOException, AuthenticationException;

	@TransactionAttribute
	public abstract boolean checkSessionForUser(String name, String sessionID) throws DAOException;

	@TransactionAttribute
	public abstract int createUser(String name, String password, Role role) throws DAOException, AuthenticationException;

	@TransactionAttribute
	public abstract User getUserData(String name) throws DAOException;

	@TransactionAttribute
	public abstract void deleteUser(User user) throws DAOException;

	@TransactionAttribute
	public abstract void clearSessionforUser(User user) throws DAOException;

	@TransactionAttribute
	public abstract void clearExpiredSessions();

	@TransactionAttribute
	public abstract boolean checkIfUserIsOwner(String userName, int GameItemID)throws DAOException;
	
	


}